<?php
/**
 * Created by PhpStorm OF yuyi.
 * User: YUYI
 * Date: 2018/5/21 0021
 * Time: 上午 9:16
 * Administrator
 */

namespace app\index\controller;


use app\common\controller\Base;
use app\common\model\Articles;
use app\common\model\Users;
use app\common\service\ArticleService;

class User extends Base
{
    protected $isPublic = 'articles';

    public function index()
    {

    }

    public function articles($userid)
    {
        $viewUser = Users::get($userid);
        $this->assign('vUser',$viewUser);
        $this->assign('articles',Articles::all(['userId'=>$userid,'status'=>99]));
        ArticleService::getHotArticle(['status'=>99,'userId'=>$userid],3);
        return $this->fetch();
    }
}